package com.exercises;

class Exercise633 {

    public static void main(String[] args) {
        System.out.println(new Exercise633().judgeSquareSum(1000));
    }


    public boolean judgeSquareSum(int c) {
        int count = 0;
        int i = 0, j = c - i * i;
        while (j >= 0) {
            count++;
            int sqrt = (int) Math.sqrt(j);
            if (j == sqrt * sqrt) {
                System.out.println(i + "   " + j);
                return true;
            }
            i++;
            j = c - i * i;

        }
        System.out.println(count);
        return false;
    }


}
